package com.meta.nd.vo;

import lombok.Data;

@Data
public class ReturnMessage<T> {
	private boolean success = true;
	private String code;
	private String message;
	private  String detailMessage;
	private T value;
	

	public ReturnMessage(){
	}
	public ReturnMessage( boolean success, String message, T result) {
		this.success = success;
		this.message = message;
		this.value = result;
	}

	
	public ReturnMessage ( String message ){
		this.success = false;
		this.message = message;
	}


	public ReturnMessage ( T value, boolean  success ){
		this.success = success;
		this.value = value;
	}

	public static ReturnMessage buildFailMessage(String message ,String detailMessage){
		ReturnMessage returnMessage = new ReturnMessage();
		returnMessage.setSuccess(false);
		returnMessage.message = message;
		returnMessage.detailMessage = detailMessage;
		return returnMessage;
	}

}
